import request from '@/utils/request'

//获取学生个人信息
export const getStudentInfoAPI = () => {
    return request.get('/student/my')
}
//修改学生个人信息
export const updateStudentInfoAPI = (data) => {
    return request.put('/student/my', data)
}
/**
 * 获取老师
 * @param {number} id - 老师ID
 * @param {string} relationship 和老师的关系 
 */
export const addTeacherAPI = (id,{ relationship }) => {
    return request.put(`/student/addTeacher/${id}`, null, {
        params: {
            relationship
        }
    })
}
//获取我的老师们的信息
export const getMyTeachersAPI = () => {
    return request.get('/student/myTeacher')
}

//获取未提交作业的信息
export const getUnsubmitHomeworkAPI = () => {
    return request.get('/student/homework')
}
//文件上传
export const uploadFileAPI = (data) => {
    return request.post('/student/upload', data, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

//提交作业
export const submitHomeworkAPI = (data) => {
    return request.post('/student/homework', data)
}

//获取已提交作业的信息
export const getSubmittedHomeworkAPI = () => {
    return request.get('/student/history')
}